<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数字类型</title>
</head>
<body>
    <button onclick="funNum()">点击number</button>
    <button onclick="funBigInt()">点击bigint</button>
    <button onclick="funBoolen()">点击boolen</button>
    <button onclick="funundefined()">点击undefined</button>
    <button onclick="funobject()">点击object</button>
</body>
    <script>
        function funNum(){
            var age=18
            var salary = 3654.98
            console.log(typeof(age))
            console.log(typeof(salary))
            var c = new Number('698')
            console.log(c)
            console.log(typeof(c))
        }
        function funBigInt(){
            var a1=318
            var b1=318n
            var c1=BigInt(3182)
            document.write("a1="+ a1 + "它的数据类型是"+ typeof(a1) + "<br>")
            document.write("b1="+ b1 + "它的数据类型是"+ typeof(b1) + "<br>")
            document.write("c1="+ c1 +"它的数据类型是"+ typeof(c1))
        }
        function funBoolen(){
            var a= true
            var b= false
            var c= new Boolean(true)  //通过new 得到的都是Object类型
            var d=3>5
            var e=5>3
            document.write("a="+ a + "它的数据类型是"+ typeof(a) + "<br>")
            document.write("b="+ b + "它的数据类型是"+ typeof(b) + "<br>")
            document.write("c="+ c +"它的数据类型是"+ typeof(c) + "<br>")
            document.write("d="+ d +"它的数据类型是"+ typeof(d) + "<br>")
            document.write("e="+ e +"它的数据类型是"+ typeof(e) + "<br>")
        }
        function funundefined(){
            var a
            console.log(a)
        }
        function funobject() {
            var a =new String("一二三")
            var b = new Number(11)
            var c= BigInt(11)
            var d = new Boolean(true)
            console.log(a)
            console.log("a="+ a +"它的数据类型是"+ typeof(a) + "<br>")
            console.log(b)
            console.log("b="+ b +"它的数据类型是"+ typeof(b) + "<br>")
            console.log(c)
            console.log("c="+ c +"它的数据类型是"+ typeof(c) + "<br>")
            console.log(d)
        }
    </script>
</html>